package com.iplant.basic.service.po.bfc;

import java.io.Serializable;
import java.util.Calendar;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBCutTableModes;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.multi.DBJoinMulti;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.basic.service.basicenum.bpm.BPMEventModule;

@DBBasePO(TableName = "bfc_message", CheckName = {"MessageID,ModuleID,StepID,StationID,ResponsorID,Type"}, Code = false, Name = false,
		Schemas = DBSchemas.Basic,CutTableMode = DBCutTableModes.Year,IndexCol = {"CreateTime","ResponsorID","MessageID","StepID"})
public class BFCMessage extends BasePO implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	public BFCMessage() {
		// TODO Auto-generated constructor stub
	}
	@DBCondition
	@DBField
	public int CompanyID;
	/**
	 * 消息来源ID 如EXC的任务ID
	 */
	@DBCondition
	@DBField
	public int MessageID;

	/**
	 * 配置模块ID BPMEventModule
	 */
	@DBCondition
	@DBField
	public int ModuleID;

	public String ModuleName = "";
	/**
	 *
	 */
	@DBCondition
	@DBField
	public int StationID;

	@DBJoinMulti(Name="Code",TableName = "fmc_station",MainTableField = "StationID")
	public String StationNo;

	@DBCondition
	@DBField
	public int StepID = 0;

	/**
	 * 消息接收人ID
	 */
	@DBCondition
	@DBField
	public int ResponsorID;

	/**
	 * 0 默认 不需要执行 1 需要执行
	 */
	@DBCondition
	@DBField
	public int Type;

	@DBField
	public String Title = "";
	@DBField
	public String MessageText = "";
	@DBCondition
	@DBField
	public int ShiftID = 0;


//	/**
//	 * 0 未读 // 1 已发送未读 // 2 已读 （已读后不发送了） //3 已办 // 4 已关闭
//	 */
	//public int Active = 0;

	/**
	 * 0001为门户推送 0010 为手机推送 0100 为WEB推送 三端都推后状态变更
	 */
	@DBCondition(CompareType = DBCondition.DBCompareType.Combine)
	@DBField
	public int SendStatus = 0;


	@JsonProperty("MessageID")
	public int getMessageID() {
		return MessageID;
	}

	public void setMessageID(int messageID) {
		MessageID = messageID;
	}

	@JsonProperty("ModuleID")
	public int getModuleID() {

		return ModuleID;
	}

	public void setModuleID(int moduleID) {
		ModuleID = moduleID;
	}

	@JsonProperty("ResponsorID")
	public int getResponsorID() {
		return ResponsorID;
	}

	public void setResponsorID(int responsorID) {
		ResponsorID = responsorID;
	}

	@JsonProperty("Type")
	public int getType() {
		return Type;
	}

	public void setType(int type) {
		Type = type;
	}

	@JsonProperty("Title")
	public String getTitle() {
		return Title;
	}

	public void setTitle(String title) {
		Title = title;
	}

	@JsonProperty("MessageText")
	public String getMessageText() {
		return MessageText;
	}

	public void setMessageText(String messageText) {
		MessageText = messageText;
	}

	@JsonProperty("EditTime")
	public Calendar getEditTime() {
		return EditTime;
	}

	public void setEditTime(Calendar editTime) {
		EditTime = editTime;
	}

	@JsonProperty("CreateTime")
	public Calendar getCreateTime() {
		return CreateTime;
	}

	public void setCreateTime(Calendar createTime) {
		CreateTime = createTime;
	}

	@JsonProperty("StationID")
	public int getStationID() {
		return StationID;
	}

	public void setStationID(int stationID) {
		StationID = stationID;
	}

	@JsonProperty("CompanyID")
	public int getCompanyID() {
		return CompanyID;
	}

	public void setCompanyID(int companyID) {
		CompanyID = companyID;
	}

	@JsonProperty("ShiftID")
	public int getShiftID() {
		return ShiftID;
	}

	public void setShiftID(int shiftID) {
		ShiftID = shiftID;
	}

	@JsonProperty("StationNo")
	public String getStationNo() {
		return StationNo;
	}

	public void setStationNo(String stationNo) {
		StationNo = stationNo;
	}

	@JsonProperty("Active")
	public int getActive() {
		return Active;
	}

	public void setActive(int active) {
		Active = active;
	}

	@JsonProperty("StepID")
	public int getStepID() {
		return StepID;
	}

	public void setStepID(int stepID) {
		StepID = stepID;
	}

	@JsonProperty("ModuleName")
	public String getModuleName() {
		ModuleName= BPMEventModule.getEnumType(ModuleID).getLabel();
		return ModuleName;
	}

	public void setModuleName(String moduleName) {
		ModuleName = moduleName;
	}

	@JsonProperty("SendStatus")
	public int getSendStatus() {
		return SendStatus;
	}

	public void setSendStatus(int sendStatus) {
		SendStatus = sendStatus;
	}

}
